package com.zh.note.huawei.onehundred.黑板上色or数字涂色;

/**
 * @Author: zhanghuan
 * @date: 2023/9/4 13:36
 * @description: create it
 *
 * 3
 * 2 4 6
 */

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int count = 0;
        for (int i = 0; i < n; i++) {
            int num = s.nextInt();
            if (num == 1) {
                count++;
            } else if (isPrime(num)) {
                count++;
            }
        }
        System.out.println(count);
    }

    private static boolean isPrime(int num) {
        if (num < 2) {
            return false;
        }
        for (int i = 2; i * i <= num; i++) {
            if (num % i == 0) {
                return false;
            }
        }
        return true;
    }
}

